import tkinter as tk

root = tk.Tk()

screen_width = root.winfo_screenwidth()
screen_height = root.winfo_screenheight()
window_width = root.winfo_reqwidth()
window_height = root.winfo_reqheight()

x = (screen_width - window_width) // 2
y = (screen_height - window_height) // 2

root.geometry(f"+{x}+{y}")

root.mainloop()